﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="sales.aspx.vb" Inherits="prueba.WebForm8" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            height: 21px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table id="table1" style="width:100%;">
    <tr>
        <td>
            <asp:GridView ID="GridView1" runat="server" DataSourceID="salesSqlDataSource1" 
                AutoGenerateColumns="False" DataKeyNames="stor_id,ord_num,title_id">
                <Columns>
                    <asp:BoundField DataField="stor_id" HeaderText="stor_id" ReadOnly="True" 
                        SortExpression="stor_id" />
                    <asp:BoundField DataField="ord_num" HeaderText="ord_num" ReadOnly="True" 
                        SortExpression="ord_num" />
                    <asp:BoundField DataField="ord_date" HeaderText="ord_date" 
                        SortExpression="ord_date" />
                    <asp:BoundField DataField="qty" HeaderText="qty" SortExpression="qty" />
                    <asp:BoundField DataField="payterms" HeaderText="payterms" 
                        SortExpression="payterms" />
                    <asp:BoundField DataField="title_id" HeaderText="title_id" ReadOnly="True" 
                        SortExpression="title_id" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="salesSqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:pubsConnectionString17 %>" 
                DeleteCommand="DELETE FROM [sales] WHERE [stor_id] = @stor_id AND [ord_num] = @ord_num AND [title_id] = @title_id" 
                InsertCommand="INSERT INTO [sales] ([stor_id], [ord_num], [ord_date], [qty], [payterms], [title_id]) VALUES (@stor_id, @ord_num, @ord_date, @qty, @payterms, @title_id)" 
                SelectCommand="SELECT * FROM [sales]" 
                UpdateCommand="UPDATE [sales] SET [ord_date] = @ord_date, [qty] = @qty, [payterms] = @payterms WHERE [stor_id] = @stor_id AND [ord_num] = @ord_num AND [title_id] = @title_id">
                <DeleteParameters>
                    <asp:Parameter Name="stor_id" Type="String" />
                    <asp:Parameter Name="ord_num" Type="String" />
                    <asp:Parameter Name="title_id" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="TxtBox1stor_id" Name="stor_id" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox2ord_num" Name="ord_num" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox2ord_num" Name="ord_date" 
                        PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="TxtBox4qty" Name="qty" PropertyName="Text" 
                        Type="Int16" />
                    <asp:ControlParameter ControlID="TxtBox5payterms" Name="payterms" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox6title_id" Name="title_id" 
                        PropertyName="Text" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="ord_date" Type="DateTime" />
                    <asp:Parameter Name="qty" Type="Int16" />
                    <asp:Parameter Name="payterms" Type="String" />
                    <asp:Parameter Name="stor_id" Type="String" />
                    <asp:Parameter Name="ord_num" Type="String" />
                    <asp:Parameter Name="title_id" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
                    <asp:Label ID="Label1" runat="server" Text="stor_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox1stor_id" runat="server"></asp:TextBox>
                </td>
        <td class="style1">
            </td>
        <td class="style1">
            </td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label2" runat="server" Text="ord_num"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox2ord_num" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label3" runat="server" Text="ord_date"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox3ord_date" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label4" runat="server" Text="qty"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox4qty" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label5" runat="server" Text="payterms"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox5payterms" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label6" runat="server" Text="title_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox6title_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Button ID="Button1" runat="server" Text="Enviar" />
                    <asp:Button ID="Button2" runat="server" Text="BORRAR" style="height: 26px" />
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>
</asp:Content>
